part of pda.service;

//"id": "sale",
//"to": "/sale",
//"img": "flutter_assets/img/default/sale-bill.png",
//"visible": false,
//"text": "销售单"
class MenuItem {
  final String id;
  String to;
  String img;
  bool visible;
  String text;

  MenuItem(this.id, {this.to, this.img, this.visible = false, this.text});

  static Map<String, MenuItem> fromYamlList(yamlList) {
    Map<String, MenuItem> rtn = {};
    for (var node in yamlList) {
      var id = node['id'];
      var item = MenuItem(id,
          to: node['to'],
          img: node['img'],
          visible: node['visible'],
          text: node['text']);
      rtn[id] = item;
    }
    return rtn;
  }
}
